

class Block:
    """
        内存块类
    """
    def __init__(self, name, space, addr, process):
        """
        :param name: 块名 
        :param space: 块的剩余空间
        :param addr: 块的地址
        :param process: 块中含有的进程
        """
        self.name = name
        self.space = space
        self.addr = addr
        self.process = process

    def addProcess(self, process):
        self.space -= process.space
        self.process.append(process)

    def __repr__(self):
        return """内存块:{}, 空间剩余:{}，内存地址:{}，所含进程:{}""".format(self.name, self.space, self.addr, self.process)
